#include "urlutils.h"

#include <QClipboard>
#include <QApplication>

const QUrl urlFromClipboard()
{
    QClipboard *clipboard = QApplication::clipboard();
    return QUrl(clipboard->text());
}

const bool isValidUrl(const QUrl &url)
{
    return !url.isEmpty()
        && url.isValid()
        && !url.host().isEmpty()
        && !url.scheme().isEmpty();
}

const bool isValidAndUnknownUrlInClipboard()
{
    return isValidUrl(urlFromClipboard());
}
